<template>
    <view :style="themeColor">
        <view class="page" >
    <view class="flex flex-wrap align-center justify-between benben-position-layout flex recordBargain_flex_0"    :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
            <view   class='flex flex-wrap align-center recordBargain_fd0_0'   @tap.stop="handleJumpDiy" data-type="back" data-url="1"   >
        <image class='recordBargain_fd0_0_c0'  mode="aspectFit"  :src='STATIC_URL+"234.png"'></image>
</view>
<text class='recordBargain_fd0_1'  >砍价记录</text>
    <view   class='flex flex-wrap align-center recordBargain_fd0_0'      >
        </view>

        </view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}"  ></view>
<!---flex布局flex布局开始-->
 <view class="flex flex-direction align-stretch benben-flex-layout"    >
        <view>
        <benben-flex-tabs class-name='recordBargain_benbenTabsfd1_0'  v-model="tabs" ref="benben_tabsfd1_0" select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false' :open-sticky='true' :top='88' :is-show-content='false' :scrollspy='false'  :tabs-info.sync="tabsInfofd1_0" @change="getRecordsFunc()" >
            
                    <scroll-view
          @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft"
          id="benben_tabsfd1_0"
          class="benben-tabs"
          style="width:750rpx"
          :scroll-x="true"
          :scroll-left.sync="tabsInfofd1_0.moveX"
          scroll-with-animation="all .3s ease"
        >
          <view class="benben-tabs-content" id="benben_tabsfd1_0-content">
            <view id="benben_tabsfd1_0-title" class="benben-tabs-title flex flex align-center justify-around">
                        <view 
                :class="{ 'checkTitlefd1_0': tabs == 'all', 'flex flex-wrap align-center': true }"
                @tap="tabs = 'all'"
                :id="`benben_tabsfd1_0-title-item-${'all'}`"
                
                
              >
                
<text   >全部</text>

              </view>            <view 
                :class="{ 'checkTitlefd1_0': tabs == 'bargain_buccess', 'flex flex-wrap align-center': true }"
                @tap="tabs = 'bargain_buccess'"
                :id="`benben_tabsfd1_0-title-item-${'bargain_buccess'}`"
                
                
              >
                
<text   >成功</text>

              </view>            <view 
                :class="{ 'checkTitlefd1_0': tabs == 'bargaining_failed', 'flex flex-wrap align-center': true }"
                @tap="tabs = 'bargaining_failed'"
                :id="`benben_tabsfd1_0-title-item-${'bargaining_failed'}`"
                
                
              >
                
<text   >失败</text>

              </view>
            </view>
            <view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}" id="benben_tabsfd1_0-line" class="benben-tabs-line flex benben-flex-tabs-line recordBargain_linefd1_0"></view>
          </view>
        </scroll-view>
            
        </benben-flex-tabs>
        
</view>
    <template v-for = '(item,key0) in dataMessage'>
    <view   class='flex flex-direction flex-wrap align-stretch flex-sub recordBargain_fd1_1'       :key='key0'>
            <view   class='flex flex-direction flex-wrap align-stretch recordBargain_fd1_1_c0'    v-if= " in_array(item.is_bargain,'1,2')"  >
            <view   class='flex flex-direction flex-wrap align-stretch recordBargain_fd1_1_c0_c0'      >
            <view   class='flex flex-wrap align-stretch'   @tap="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/sy/AskaFriendforHelp/AskaFriendforHelp?thumb=${item.goods_thumb}&sn=${item.order_sn}&goods_id=${item.goods_id}`"   >
            <view   class='flex flex-wrap align-center recordBargain_fd1_1_c0_c0_c0_c0'      >
        <image class='recordBargain_fd1_1_c0_c0_c0_c0_c0'  mode="aspectFill"  :src='item.goods_thumb'></image>
<image class='recordBargain_fd1_1_c0_c0_c0_c0_c1'  mode="aspectFit"  :src='STATIC_URL+"16.png"'></image>
</view>
    <view   class='flex flex-direction flex-wrap align-stretch flex-sub recordBargain_fd1_1_c0_c0_c0_c1'      >
        <text class='recordBargain_fd1_1_c0_c0_c0_c1_c0'  >{{item.goods_name}}</text>
    <view   class='flex flex-wrap align-center recordBargain_fd1_1_c0_c0_c0_c1_c1'    v-if= "item.is_bargain=='1'"  >
        <image class='recordBargain_fd1_1_c0_c0_c0_c1_c1_c0'  mode="aspectFit"  :src='STATIC_URL+"19.png"'></image>
<text class='recordBargain_fd1_1_c0_c0_c0_c1_c1_c1'    v-if= "item.is_bargain=='1'"  >剩余时间：</text><text class='recordBargain_fd1_1_c0_c0_c0_c1_c1_c1_1'    v-if= "item.is_bargain!='1'"  >{{item.kj_title}}</text>
<benben-countdown class='recordBargain_fd1_1_c0_c0_c0_c1_c1_c2'  :show-day='false' :time-type='false'  :count-time="item.cut_end_time_second"  v-if= "item.is_bargain=='1'">
            <template #default="{ d, h, i, s }">
<text   >{{h}}</text>

<text   >:</text>

<text   >{{i}}</text>

<text   >:</text>

<text   >{{s}}</text>

<text   ></text>
            </template>
</benben-countdown>
</view>
    <view   class='flex flex-wrap align-center justify-between recordBargain_fd1_1_c0_c0_c0_c1_c2'      >
            <view   class='flex flex-direction flex-wrap align-stretch'      >
            <view   class='flex flex-wrap align-end'      >
        <text class='recordBargain_fd1_1_c0_c0_c0_c1_c2_c0_c0_c0'  >已砍至： ¥</text>
<text class=' recordBargain_fd1_1_c0_c0_c0_c1_c2_c0_c0_c1'   >
    <text >{{ item.price | frontPrice }}</text>
    <text >{{ item.price | laterPrice }}</text>
</text>
</view>
</view>
    <view   class='flex flex-wrap align-center recordBargain_fd1_1_c0_c0_c0_c1_c2_c1'      >
        <text   >x</text>
<text   >{{item.num}}</text>
</view>
</view>
</view>
</view>
</view>
    <view   class='flex align-center justify-between recordBargain_fd1_1_c0_c1'      >
        <text class='recordBargain_fd1_1_c0_c1_c0'    v-if= "item.is_bargain=='1'"  >{{item.kj_title}}</text>
    <view   class='flex flex-wrap align-center'      >
        <button class='recordBargain_fd1_1_c0_c1_c1_c0'  @tap="clickCancelFunc(item.order_sn)" v-if= " item.is_bargain=='1'" >取消活动</button>
<button class='recordBargain_fd1_1_c0_c1_c1_c1'   v-if= " item.is_bargain=='3'" >继续砍价</button>
<button class='recordBargain_fd1_1_c0_c1_c1_c1'   v-if= " item.is_bargain=='2'" >砍价成功</button>
</view>
</view>
</view>
    <view   class='flex flex-direction flex-wrap align-stretch recordBargain_fd1_1_c0'    v-if= " in_array(item.is_bargain,'3,4')"  >
            <view   class='flex flex-direction flex-wrap align-stretch recordBargain_fd1_1_c0_c0'      >
            <view   class='flex flex-wrap align-stretch'   @tap="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/sy/knifeYourselfCut/knifeYourselfCut?thumb=${item.goods_thumb}&sn=${item.order_sn}&goods_id=${item.goods_id}`"   >
            <view   class='flex flex-wrap align-center recordBargain_fd1_1_c0_c0_c0_c0'      >
        <image class='recordBargain_fd1_1_c0_c0_c0_c0_c0'  mode="aspectFill"  :src='item.goods_thumb'></image>
<image class='recordBargain_fd1_1_c0_c0_c0_c0_c1'  mode="aspectFit"  :src='STATIC_URL+"16.png"'></image>
</view>
    <view   class='flex flex-direction flex-wrap align-stretch flex-sub recordBargain_fd1_1_c0_c0_c0_c1'      >
        <text class='recordBargain_fd1_1_c0_c0_c0_c1_c0'  >{{item.goods_name}}</text>
    <view   class='flex flex-wrap align-center recordBargain_fd1_1_c0_c0_c0_c1_c1'    v-if= "item.is_bargain=='1'"  >
        <image class='recordBargain_fd1_1_c0_c0_c0_c1_c1_c0'  mode="aspectFit"  :src='STATIC_URL+"19.png"'></image>
<text class='recordBargain_fd1_1_c0_c0_c0_c1_c1_c1'    v-if= "item.is_bargain=='1'"  >剩余时间：</text><text class='recordBargain_fd1_1_c0_c0_c0_c1_c1_c1_1'    v-if= "item.is_bargain!='1'"  >{{item.kj_title}}</text>
<benben-countdown class='recordBargain_fd1_1_c0_c0_c0_c1_c1_c2'  :show-day='false' :time-type='false'  :count-time="item.cut_end_time_second"  v-if= "item.is_bargain=='1'">
            <template #default="{ d, h, i, s }">
<text   >{{h}}</text>

<text   >:</text>

<text   >{{i}}</text>

<text   >:</text>

<text   >{{s}}</text>

<text   ></text>
            </template>
</benben-countdown>
</view>
    <view   class='flex flex-wrap align-center justify-between recordBargain_fd1_1_c0_c0_c0_c1_c2'      >
            <view   class='flex flex-direction flex-wrap align-stretch'      >
            <view   class='flex flex-wrap align-end'      >
        <text class='recordBargain_fd1_1_c0_c0_c0_c1_c2_c0_c0_c0'  >已砍至： ¥</text>
<text class=' recordBargain_fd1_1_c0_c0_c0_c1_c2_c0_c0_c1'   >
    <text >{{ item.price | frontPrice }}</text>
    <text >{{ item.price | laterPrice }}</text>
</text>
</view>
</view>
    <view   class='flex flex-wrap align-center recordBargain_fd1_1_c0_c0_c0_c1_c2_c1'      >
        <text   >x</text>
<text   >{{item.num}}</text>
</view>
</view>
</view>
</view>
</view>
    <view   class='flex flex-wrap align-center justify-between recordBargain_fd1_1_c0_c1'      >
        <text class='recordBargain_fd1_1_c1_c1_c0'    v-if= "item.is_bargain!='1'"  >{{item.kj_title}}</text>
<button class='recordBargain_fd1_1_c1_c1_c1'   v-if= " item.is_bargain=='1'" >取消活动</button>
</view>
</view>
</view>
    </template>
    <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData" :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
</view>
        
<!---flex布局flex布局结束-->
<benben-popup v-model="popupShow1692873342768" :mask="true" :mask-close-able="true"  mode='center' >
    <!---清除本地缓存flex布局开始-->
 <view class="flex benben-flex-layout flex-wrap align-center"    >
            <view   class='flex flex-direction flex-wrap align-center recordBargain_fd2_0'      >
        <text class='recordBargain_fd2_0_c0'  >提示</text>
<text class='recordBargain_fd2_0_c1'  >确定要取消该订单？</text>
    <view   class='flex flex-wrap align-center recordBargain_fd2_0_c2'      >
        <button class='recordBargain_fd2_0_c2_c0'  @tap="popupShow1692873342768=false"  >取消</button>
<button class='recordBargain_fd2_0_c2_c1'  @tap="cancelOrderFunc()"  >确认</button>
</view>
</view>
</view>
        
<!---清除本地缓存flex布局结束-->
    
</benben-popup>
    
    
        </view>
    </view>
</template>
<script>
    import pagingList from '@/common/mixin/paging_list.js';
import {validate} from '@/common/utils/validate.js'
    export default {
        components:{},
        mixins: [pagingList],
        
        data(){
			return {"popupShow1692873342768":false,"tabsInfofd1_0":{ lineleft: '', lineWidth: '', moveX: 0, scrollX: 0, PageScrollX: 0 },"minixPagingListsApi":"","pageingListApiMethod":"","allowOnloadGetList":false,"dataMessage":[],"tabs":"all","orderSn":"","type":""};
		},
		computed:{
            themeColor() {
              return this.$store.getters.themeColor
            },
            
		},
		watch:{},
		onLoad(options){
            let {type}=options
if (type !== undefined) this.type = type
		},
        onUnload() {
                
        },
		onReady(){
            
		},
		onShow(){
            this.getRecordsFunc()
		},
		onHide(){
            
		},
		onResize(){
            
		},
		onPullDownRefresh(){
            this.getRecordsFunc()
		},
		onReachBottom(e){
            
		},
		onPageScroll(e){
            
		},
		methods:{
                            //营销活动-砍价记录
                 getRecordsFunc(){
                                    this.minixPagingListsApi = global.apiUrls.post64257b27a7650;
                this.pageingListApiMethod = 'post';
                this.allowOnloadGetList = false;
                this.pagingListPostDataContent = {type:this.tabs}
                this.listData = [];
                this.dataMessage = this.listData;
                this.pagingListToggle();
                
                },
                //取消订单
                async cancelOrderFunc(){
                        //请求方法
    //数据验证
    
  let data64e71291ddc97 = await this.$api.post(global.apiUrls.post64e71291ddc97, {
    order_sn:this.orderSn
  });
  
  if (data64e71291ddc97.data.code != 1) {
    this.$message.info(data64e71291ddc97.data.msg);
    return
  } 
  
  
  
                    this.getRecordsFunc()
    this.popupShow1692873342768 = false;
                    this.$message.info('已取消');
                },
                //点击取消
                 clickCancelFunc(orderSn){
                       this.orderSn = orderSn;
    this.popupShow1692873342768 = true;
                },
                pagingListPostData(){
                    return this.pagingListPostDataContent
                }
		}
    };
</script> 
<style lang="scss" scoped>
           .page{
            width: 100vw;
            overflow-x: hidden;
            min-height: calc(100vh - var(--window-bottom));
            background:#F8F8F8;background-size: 100% auto;
        }
    .recordBargain_flex_0{
        background:#fff;width:750rpx;height:88rpx;overflow:hidden;z-index:10;top:0rpx;background-size:100% auto !important;
    }
    .recordBargain_fd0_1{
        color:#333333;font-size:36rpx;font-weight:500;line-height:50rpx;
    }
    .recordBargain_fd0_0_c0{
        width:20rpx;height:36rpx;border-radius:0rpx 0rpx 0rpx 0rpx;margin:0rpx 0rpx 0rpx 32rpx;
    }
    .recordBargain_fd0_0{
        width:100rpx;height:88rpx;
    }
    .recordBargain_fd1_1_c1_c1_c1{
        background:var(--benbenbgColor5);width:160rpx;height:56rpx;border-radius:28rpx 28rpx 28rpx 28rpx;color:var(--benbenFontColor0);font-size:24rpx;line-height:56rpx;font-weight:600;margin:0rpx 0rpx 0rpx auto;
    }
    .recordBargain_fd1_1_c1_c1_c0{
        background:var(--benbenbgColor5);color:var(--benbenFontColor2);font-size:22rpx;font-weight:600;background-size:100% auto;padding:9rpx 28rpx 9rpx 18rpx;border-radius:0rpx 28rpx 28rpx 0rpx;
    }
    .recordBargain_fd1_1_c0_c1_c1_c1{
        background:var(--benbenbgColor7);width:160rpx;height:56rpx;border-radius:28rpx 28rpx 28rpx 28rpx;color:var(--benbenFontColor3);font-size:24rpx;line-height:56rpx;font-weight:600;margin:0rpx 7rpx 0rpx auto;
    }
    .recordBargain_fd1_1_c0_c1_c1_c0{
        background:var(--benbenbgColor5);width:160rpx;height:56rpx;border-radius:28rpx 28rpx 28rpx 28rpx;color:var(--benbenFontColor0);font-size:24rpx;line-height:56rpx;font-weight:600;margin:0rpx 24rpx 0rpx auto;
    }
    .recordBargain_fd1_1_c0_c1_c0{
        background:var(--benbenbgColor8);color:var(--benbenFontColor5);font-size:22rpx;font-weight:600;background-size:100% auto;padding:9rpx 28rpx 9rpx 18rpx;border-radius:0rpx 28rpx 28rpx 0rpx;
    }
    .recordBargain_fd1_1_c0_c1{
        margin:32rpx 0rpx 0rpx 0rpx;padding:0rpx 24rpx 0rpx 0rpx;
    }
    .recordBargain_fd1_1_c0_c0_c0_c1_c2_c1{
        font-size:33rpx;font-weight:400;color:#BDBEBE;
    }
    .recordBargain_fd1_1_c0_c0_c0_c1_c2_c0_c0_c1{
        color:var(--benbenFontColor7);font-weight:400;font-size:33rpx;
    }
    .recordBargain_fd1_1_c0_c0_c0_c1_c2_c0_c0_c0{
        color:var(--benbenFontColor7);font-size:24rpx;font-weight:700;margin:0rpx 0rpx 3rpx 0rpx;
    }
    .recordBargain_fd1_1_c0_c0_c0_c1_c2{
        margin:0rpx 12rpx 0rpx 0rpx;
    }
    .recordBargain_fd1_1_c0_c0_c0_c1_c1_c2{
        background:#FFFFFF;
    }
    .recordBargain_fd1_1_c0_c0_c0_c1_c1_c1_1{
        color:var(--benbenFontColor1);font-size:20rpx;font-weight:400;line-height:22rpx;
    }
    .recordBargain_fd1_1_c0_c0_c0_c1_c1_c1{
        color:var(--benbenFontColor4);font-size:20rpx;font-weight:400;
    }
    .recordBargain_fd1_1_c0_c0_c0_c1_c1_c0{
        width:26rpx;height:26rpx;border-radius:0rpx 0rpx 0rpx 0rpx;margin:0rpx 8rpx 0rpx 0rpx;
    }
    .recordBargain_fd1_1_c0_c0_c0_c1_c1{
        color:var(--benbenFontColor4);margin:16rpx 0rpx auto 0rpx;
    }
    .recordBargain_fd1_1_c0_c0_c0_c1_c0{
        font-size:28rpx;font-weight:600;color:#333;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;
    }
    .recordBargain_fd1_1_c0_c0_c0_c1{
        margin:0rpx 0rpx 0rpx 24rpx;
    }
    .recordBargain_fd1_1_c0_c0_c0_c0_c1{
        width:112rpx;height:40rpx;border-radius:0rpx 0rpx 0rpx 0rpx;position:absolute;top:0rpx;left:0rpx;
    }
    .recordBargain_fd1_1_c0_c0_c0_c0_c0{
        width:200rpx;height:200rpx;border-radius:16rpx 16rpx 16rpx 16rpx;margin:0rpx 0rpx 0rpx 6rpx;
    }
    .recordBargain_fd1_1_c0_c0_c0_c0{
        position:relative;
    }
    .recordBargain_fd1_1_c0_c0{
        border-bottom:1px solid rgba(238, 238, 238, 1);padding:0rpx 24rpx 32rpx 24rpx;
    }
    .recordBargain_fd1_1_c0{
        background:#fff;border-radius:23rpx 23rpx 23rpx 23rpx;padding:34rpx 0rpx 32rpx 0rpx;background-size:100% auto !important;margin:24rpx 0rpx 0rpx 0rpx;
    }
    .recordBargain_fd1_1{
        padding:0rpx 24rpx 0rpx 24rpx;
    }
    .recordBargain_linefd1_0{
        background:var(--benbenbgColor7);width:50rpx;height:8rpx;top:80rpx;background-size:100% auto !important;border-radius:10rpx 10rpx 10rpx 10rpx;
    }
    .checkTitlefd1_0{
        font-weight:700 !important;font-size:32rpx !important;color:rgba(0, 142, 77, 1) !important;background-color:rgba(255, 255, 255, 1) !important;
    }
    ::v-deep .recordBargain_benbenTabsfd1_0{
        background:#fff;width:750rpx;height:90rpx;white-space:nowrap;text-align:center;font-size:32rpx;font-weight:400;color:#333333;
    }
    .recordBargain_fd2_0_c2_c1{
        background:#fff;font-size:32rpx;color:var(--benbenFontColor5);width:263rpx;height:101rpx;line-height:101rpx;font-weight:500;
    }
    .recordBargain_fd2_0_c2_c0{
        border-right:1px solid #eee;background:#fff;font-size:32rpx;color:rgba(51, 51, 51, 1);width:270rpx;height:101rpx;line-height:101rpx;font-weight:400;
    }
    .recordBargain_fd2_0_c2{
        border-top:1px solid #eee;margin:51rpx 0rpx 0rpx 0rpx;
    }
    .recordBargain_fd2_0_c1{
        line-height:44rpx;font-size:28rpx;font-weight:500;color:#333333;text-align:center;margin:32rpx 40rpx 0rpx 40rpx;
    }
    .recordBargain_fd2_0_c0{
        line-height:44rpx;font-size:36rpx;font-weight:700;color:#333333;margin:40rpx 0rpx 0rpx 0rpx;
    }
    .recordBargain_fd2_0{
        background:#fff;width:540rpx;background-size:100% auto !important;border-radius:16rpx 16rpx 16rpx 16rpx;
    }
</style>